import Vue from 'vue'
import 'xe-utils'
import VXETable from 'vxe-table'
import 'vxe-table/lib/index.css'

VXETable.setup({
  size: 'small',
  table: {
    stripe: true,
    border: true,
    resizable: true,
    showOverflow: true,
    align: 'center',
    editConfig: {
      enabled: true,
      trigger: 'click', // 设置触发编辑为手动模式
      mode: 'cell', // 设置为整行编辑模式
      showStatus: false
    },
    keepSource: true,
    emptyText: '暂无数据',
    exportConfig: {
      filename: '',
      sheetName: 'Sheet1',
      // 默认选中类型
      type: 'xlsx',
      // 自定义类型
      types: ['csv', 'html', 'xml', 'txt'],
      mode: 'current',
      isMerge: true,
      isColgroup: false
    },
    treeConfig: {
      children: 'children'
    },
    sortConfig: {
      remote: true,
      trigger: 'default',
      orders: ['asc', 'desc', null],
      sortMethod: null
    }
  }
})

Vue.use(VXETable)
Vue.prototype.$XModal = VXETable.modal
